package com.ss.android.article.base.feature.detail2.picgroup.view;

import android.view.MotionEvent;
import android.view.View;
import android.view.View;

final class a implements View.OnTouchListener {
    private final PictureDetailLayout e;
    private float a;
    private float b;
    private boolean c;
    private boolean d;

    a(PictureDetailLayout arg1) {
        this.e = arg1;

    }

    public final boolean onTouch(View arg12, MotionEvent arg13) {
        boolean v9 = false;
        float v0 = Math.abs(arg13.getX() - this.a);
        float v1 = Math.abs(arg13.getY() - this.b);
        switch(arg13.getActionMasked()) {
            case 0: {
                this.e.u = true;
                this.e.v = this.e.a.getTranslationY();
                this.c = false;
                this.a = arg13.getX();
                this.b = arg13.getY();
                break;
            }
            case 2: {
                if(this.c) {
                    break;
                }

                if(v0 <= this.e.n && v1 <= this.e.n) {
                    break;
                }

                this.c = true;
                boolean v0_1 = v0 > v1 * 2f ? true : false;
                this.d = v0_1;
                if(this.d) {
                    break;
                }else {
                    this.e.b.dispatchTouchEvent(MotionEvent.obtain(arg13.getDownTime(), arg13.getEventTime(), 3, arg13.getX(), arg13.getY(), arg13.getMetaState()));
                    this.e.a.getParent().requestDisallowInterceptTouchEvent(true);
                    break;
                }
            }
        }

        if(!this.c) {
            this.e.b.dispatchTouchEvent(arg13);
        }
        else if(this.d) {
            this.e.b.dispatchTouchEvent(arg13);
            v9 = true;
        }

        return v9;
    }
}

